package controllers

import (
	"gitverse.ru/synapse/kubelatte/pkg/util"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes/fake"
	"testing"
)

func TestCheckNamespace(t *testing.T) {
	selectorTrue := util.NamespaceSelector{
		LabelSelector: metav1.LabelSelector{
			MatchExpressions: []metav1.LabelSelectorRequirement{
				{
					Key:      "Test",
					Operator: "In",
					Values:   []string{"Test"},
				},
			},
		},
		Include: []string{
			"Test",
		},
		Exclude: nil,
	}
	kubeClient = fake.NewSimpleClientset(&v1.Namespace{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "Test",
			Namespace: "",
			Labels: map[string]string{
				"Test": "Test",
			},
		},
	})
	CheckNamespace("Test", &selectorTrue)
}
